summaryrefslogtreecommitdiff
path: root/frontend/app/drive/[...path]/page.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app/drive/[...path]/page.tsx')
-rw-r--r--frontend/app/drive/[...path]/page.tsx58
1 files changed, 0 insertions, 58 deletions
diff --git a/frontend/app/drive/[...path]/page.tsx b/frontend/app/drive/[...path]/page.tsx
deleted file mode 100644
index be11253..0000000
--- a/frontend/app/drive/[...path]/page.tsx
+++ /dev/null
@@ -1,58 +0,0 @@
1import { Drive_ls } from "@/lib/drive_server"
2import { Drive_parent } from "@/lib/drive_shared"
3import Link from "next/link"
4import { Auth_get_user, Auth_user_can_upload } from "@/lib/auth";
5import FileUpload from "@/components/FileUpload"
6import FileTable from "@/components/FileTable"
7
8interface DrivePageProps {
9 params: Promise<{
10 path: string[]
11 }>
12}
13
14export default async function DrivePage({ params }: DrivePageProps) {
15 // Await params as required by Next.js 15
16 const { path } = await params
17
18 const user = await Auth_get_user();
19
20 // Construct the full path from params
21 const fullPath = path ? `/${path.join('/')}` : ""
22
23 const entries = await Drive_ls(fullPath, false)
24
25 // Check if we have a parent directory
26 const parentDir = Drive_parent(fullPath)
27 const parentPath = path && path.length > 1
28 ? `/drive/${path.slice(0, -1).join('/')}`
29 : path && path.length === 1
30 ? '/drive'
31 : null
32
33 const showParent = parentDir !== null && parentPath !== null
34
35 return (
36 <div className="min-h-screen bg-background">
37 <div className="container mx-auto p-4">
38 <Link href="/drive" className="inline-block mb-6">
39 <h1 className="text-2xl font-bold text-foreground hover:text-blue-600 dark:hover:text-blue-400 transition-colors cursor-pointer">FCTDrive</h1>
40 </Link>
41
42 <FileTable
43 entries={entries}
44 currentPath={fullPath}
45 showParent={showParent}
46 parentPath={parentPath || undefined}
47 />
48
49 {/* File Upload Component */}
50 {Auth_user_can_upload(user) && (
51 <FileUpload
52 targetPath={fullPath}
53 />
54 )}
55 </div>
56 </div>
57 )
58}